const http = require('http')//核心模块
const server = http.createServer()

server.on('request', (req, res) => {
  /* 设置响应头 */
  res.setHeader('Content-Type', 'text/html;charset=utf-8')
  res.end('[1,2,3,4,5]')//只能返回字符串
})

server.listen('3333', '', () => {
  console.log('http://127.0.0.1:3333');
})